﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NicoView.Model.Browser
{

    public enum UrlExecuteBrowser
    {
        Default,
        InternetExproler,
        FireFox,
        GoogleChrome
    }

    /// <summary>
    /// にこびゅで提供されているブラウザ
    /// </summary>
    public abstract class  NicoViewBrowser
    {
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="name"></param>
        public NicoViewBrowser(string name,UrlExecuteBrowser browser)
        {
            Name = name;
            this.UrlExecuteBrowser = browser;
        }

        /// <summary>
        /// ブラウザの名前
        /// </summary>
        public string Name { get; private set; }

        public UrlExecuteBrowser UrlExecuteBrowser { get; private set; }

        /// <summary>
        /// URLを解決(継承)
        /// </summary>
        /// <param name="url"></param>
        protected  abstract void Execute(string url);


        /// <summary>
        /// URLを解決
        /// </summary>
        /// <param name="url"></param>
        public void ExecuteUrl(string url)
        {
            try
            {
                Execute(url);
            }catch
            {

            }
        }
    }
}
